package com.company.service;

import com.company.dao.CompanyDao;
import com.company.entity.Company;
import com.company.query.CompanyQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CompanyService {

    CompanyDao companyDao;

    public CompanyService(CompanyDao companyDao) {
        this.companyDao = companyDao;
    }

    public List<Company> getAll(){
        return companyDao.getAll();
    }

    public void addCompany(Company company){
        companyDao.addCompany(company);
    }

    public void deleteCompany(Integer key){
        companyDao.deleteCompany(key);
    }

    public List<Company> getCompanyByCon(CompanyQuery companyQuery){
        return companyDao.getCompanyByCon(companyQuery);
    }
}
